package com.project.service.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.project.bean.SellCountBean;
import com.project.mapper.ISellCountMapper;
import com.project.service.ISellCountService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.time.LocalDate;
@Service
public class SellCountServiceImpl implements ISellCountService {
    @Autowired
    private ISellCountMapper mapper;
    @Override
    public PageInfo<SellCountBean> findByItem(int pageNO, String name, LocalDate startDate, LocalDate endDate) {
        PageHelper.startPage(pageNO, 3);
        PageInfo pageInfo = PageInfo.of(mapper.findByItem(name, startDate, endDate));
        return pageInfo;
    }
}
